#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int i = 0;
	int j = 0;
	int count = 0;
	scanf("%d %d", &i, &j);
	int ret = i ^ j;
	while (ret)
	{
		ret = ret & (ret - 1);
		count++;
	}
	printf("%d\n", count);
	return 0;
}